import { Body, Controller, Post, UnauthorizedException } from '@nestjs/common'
import { AuthService } from './auth.service'
import { ApiTags } from '@nestjs/swagger'
import { UserService } from '../user/user.service'
import { LoginDto } from './auth.dto'
import { Public } from './constants'

@ApiTags('权限管理')
@Controller('auth')
export class AuthController {
  constructor(
    private readonly authService: AuthService,
    private userService: UserService,
  ) {}

  @Public()
  @Post('/login')
  async login(@Body() loginParams: LoginDto): Promise<any> {
    return this.authService.login(loginParams)
  }
}
